package com.jkoss.dao.kc;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.RequestMapping;

import com.jkoss.pojo.kc.Homework;
import com.jkoss.pojo.kc.HomeworkExample;
import com.jkoss.tool.Page;

public interface HomeworkMapper {
    
	@Select("select  e.ename,s.sbname, h.* from t_emps e,t_homework h , t_subject s "
			+ "where e.eid=h.eid and  h.sbid=s.sbid  ORDER BY h.hkid")
	@ResultMap("com.jkoss.dao.kc.HomeworkMapper.BaseResultMap2")
	List<Homework> selectByPageAndEid(Page<Homework> page);
    
	@Select("select  e.ename,s.sbname, h.* from t_emps e,t_homework h , t_subject s "
			+ "where e.eid=h.eid and  h.sbid=s.sbid  and h.hkid=${hkid}")
	@ResultMap("com.jkoss.dao.kc.HomeworkMapper.BaseResultMap2")
	Homework selectById(@Param("hkid") int hkid);
	
	
	 @Select("select  e.ename,s.sbname, h.* from t_emps e,t_homework h , t_subject s "
				+ "where e.eid=h.eid and  h.sbid=s.sbid and h.sbid=${params.sbid}")
	 @ResultMap("com.jkoss.dao.kc.HomeworkMapper.BaseResultMap2")
	List<Homework> findHwBySbid(Page<Homework> page);
	 
	int countByExample(HomeworkExample example);

    int deleteByExample(HomeworkExample example);

    int deleteByPrimaryKey(Integer hkid);

    int insert(Homework record);

    int insertSelective(Homework record);

    List<Homework> selectByExample(HomeworkExample example);

    Homework selectByPrimaryKey(Integer hkid);

    int updateByExampleSelective(@Param("record") Homework record, @Param("example") HomeworkExample example);

    int updateByExample(@Param("record") Homework record, @Param("example") HomeworkExample example);

    int updateByPrimaryKeySelective(Homework record);

    int updateByPrimaryKey(Homework record);

   

	

	

	

	
}